package practicedemo29;

public class Student {
    //就近原则：谁离我近我就用谁


    //全局变量
    private int age = 100;

    public void method1(){
        //局部变量
        int age = 10;
        //打印局部变量
        System.out.println(age);
    }
    public void method2(){
        //局部变量
        int age = 10;
        //利用this打印全局变量
        System.out.println(this.age);
    }
}
